package com.fatmeraid.domain;


import com.baomidou.mybatisplus.annotation.*;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;

import java.time.LocalDateTime;

@Data
@Schema(description = "商品实体类")
@TableName("product_info")
public class Product {
	@Schema(description = "商品id")
	@TableId(type = IdType.ASSIGN_ID, value = "product_id")
	private Long productId;

	@Schema(description = "农户id")
	@TableField(value = "farmer_id")
	private Long farmerId;

	@Schema(description = "产品类型id")
	@TableField(value = "type_id")
	private Integer productTypeId;

	@Schema(description = "产品类型名称")
	@TableField(exist = false)
	private String productTypeName;

	@Schema(description = "产品名称")
	@TableField(value = "product_name")
	private String productName;

	@Schema(description = "产品描述")
	private String description;

	@Schema(description = "单价")
	private Double price;

	@Schema(description = "库存数量")
	private Integer stock;

	@Schema(description = "销量")
	@TableField(value = "sales_volume")
	private Integer salesVolume;

	@Schema(description = "产地")
	private String origin;

	@Schema(description = "状态：0-待审核，1-不通过，2-上架，3-下架")
	private Integer status;

	@Schema(description = "创建时间")
	@TableField(value = "create_time")
	private LocalDateTime createTime;

	@Schema(description = "更新时间")
	@TableField(value = "update_time")
	private LocalDateTime updateTime;

	// 逻辑删除
	@Schema(description = "删除标志：0-正常，1-删除")
	@TableLogic(value = "0", delval = "1")
	@TableField("`delete`")
	private Integer delete;

}
